package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpITADUpdatePageUtil extends SeleniumPageUtil {

	public final static By IIMU_SPAN_STATUS = By.id("ctl44_lblSelectStatus");
	public final static By IIMU_SELECT_STATUS = By.id("ctl44_ddlStatusToSave");
	public final static By IIMU_LINK_SAVE = By.id("ctl44_lnkSave");
	public final static By IIMU_LINK_CANCEL = By.id("ctl44_lnkCancelSave");
	
//	public static void enterITADInventoryManagementUpdatePage(){
//		SpITADDefaultPageUtil.enterITADInventoryManagementDefaultPage();
//		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpITADDefaultPageUtil.IIM_LINK_UPDATE));
//		waitForPageToLoad();
//	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				IIMU_SPAN_STATUS, IIMU_SELECT_STATUS, IIMU_LINK_SAVE, IIMU_LINK_CANCEL 
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMU_SPAN_STATUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMU_SELECT_STATUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMU_LINK_SAVE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMU_LINK_CANCEL));
	}
}
